package com.blog.controller;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpSession;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-04-20 15:22
 * FileName: BaseController
 * Description:
 */
@Slf4j
public class BaseController {

    //检查用户是否登录
    public  Object checkUser(HttpSession session){
        Object o =session.getAttribute("uid");
        if(o==null){
            log.info("用户未登录");
            return null;
        }
        log.info("用户已登录,用户ID{}",o);
        return o;
    }
}
